package com.gotloop.services;

import com.gotloop.dto.UserDTO;

/**
 * Manage user and options.
 * @author jibhaine
 *
 */
public interface UserProfileService  {

	/**
	 * gets an User by its name.
	 * @param pName User name
	 * @return an User or null.
	 */
	UserDTO findUserByName(String pName);

	/**
	 * gets an User by its email.
	 * @param pEmail User email
	 * @return an User or null.
	 */
	UserDTO findUserByEmail(String pEmail);

	/**
	 * Save or update User & config.
	 * @param pUser	the UserDTO
	 * @return persisted User.
	 */
	UserDTO saveOrUpdateUser(UserDTO pUser);
	
	/**
	 * Creates a Following relationship.
	 * @param followerName user following name
	 * @param followedName user followed name
	 * @return true if successful, false = blocked or already following.
	 */
	boolean followUser(String followerName, String followedName);
}
